package com.niit.web.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.niit.bean.Log;
import com.niit.service.LogService;
import com.niit.service.impl.LogServiceImpl;
import com.niit.utils.Page;
import com.niit.utils.WebKit;

@WebServlet("/ShowLogController")
public class ShowLogController extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doPost(request, response);
	}
	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String pagenum = request.getParameter("curpage");
		LogService ls = new LogServiceImpl();
		Page<Log> page = ls.getPage(pagenum, WebKit.getServletURI(request));
		request.setAttribute("page", page);
		request.getRequestDispatcher("/jsp/admin/load/sysm2.jsp").forward(request, response);
	}

}
